<?php

/**
 * 新闻业务逻辑切面
 */
class NewsAspect
{
    private $joinPoint;//正则
    public function setPointCut(string $joinPoint){
        $this->joinPoint=$joinPoint;
    }
    public function isJointPoint($methodName){
        return preg_match($this->joinPoint, $methodName);
    }

    /**
     * before()
     */
    public function checkUserLogin()
    {
        echo "[判断用户登录]";
    }

    /**
     * after()
     */
    public function setLog()
    {
        echo "[写入日志]";
    }
    /**
     * before()
     */
    public function checkOwner()
    {
        echo "[判断所有者]";
    }
}